import numpy as np
import matplotlib.pyplot as plt

np.random.seed(10)
X1= 2 * np.random.rand(30, 1)
X2= 3 * np.random.rand(30, 1)
Y= 2 + X1 + 3 * X2 + np.random.randn(30, 1)

X0=np.ones((30,1))
X=np.c_[X0,X1,X2]
Theta=np.linalg.inv(X.T.dot(X)).dot(X.T).dot(Y)
print(Theta)

my_list=[0,2,1,3]
X_new=np.array(my_list)
X_new=X_new.reshape(2,2)
X_new_b=np.c_[np.ones((2,1)),X_new]
Y_predict=X_new_b.dot(Theta)
print(Y_predict)